<!doctype html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <title>订单详情</title>
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/common.css" type="text/css" rel="stylesheet">
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/sale.css" type="text/css" rel="stylesheet">
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/sale-detail.css" type="text/css" rel="stylesheet">
    <style type="text/javascript">
		.process span{ #910012;font-size:16px; }
	</style>
    <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/zepto.js" charset="utf-8"></script>
	<link href="<?php echo TEMPLATE_SITE_URL;?>/css/tips.css" rel="stylesheet" type="text/css">
</head>
<body>

<div class="concernDiv" id="pop">
  <div class="concern">
  <p class="conTitle">确认后将无法再退货，货款将支付给卖家</p>
  <p class="conTitle">请确认货品完好无误！</p>
  <a class="whiteBn confirmshouhuo">确认收货</a>
  <a class="greyBn cancel">取消</a></div>
</div>

    <div id="contentbox">
    <div class="progressMain">
    				<?php if($output['order']['order_state']>2){?>
	    				<?php if(!empty($output['order']['order_comment'])){?>
	                    <div class="progressItem">
	                        <div class="content">
	                        	<a href="<?php echo BASE_SITE_URL;?>/index.php?act=payment&op=comment&order_id=<?php echo $output['order']['id'];?>">
		                        	<div class="more"><img src="<?php echo TEMPLATE_SITE_URL;?>/images/moreIcon.png" width="19" height="20"></div>
		                        </a>
	                            <div class="title finish">
	                                <div>已评价</div>
	                            </div>
	                            <div class="detail">
	                                <div class="time">评价时间：<?php echo date("Y年m月d日 H:i",$output['order']['comment_time']);?></div>
	                            </div>
	                        </div>
	                    </div>
	                    <?php }else{?>
	                    <div class="progressItem">
	                        <div class="content">
	                            <div class="title finish">
	                                <div>立即评价</div>
	                            </div>
	                            <div class="detail">
	                                <div class="time">截至时间：<?php echo date("Y年m月d日 H:i",($output['order']['shouhuo_time']+7*24*3600));?></div>
	                            </div>
	                        </div>
	                    </div>
	                    <?php }?>
    				<?php }?>
        			<?php if($output['order']['order_state']>2){?>
                    <div class="progressItem">
                        <div class="content">
                            <div class="title deal">
                                <div>已收货成功，交易完成</div>
                            </div>
                            <div class="detail">
                                <div class="time">收货时间：<?php echo date("Y年m月d日 H:i",$output['order']['shouhuo_time']);?></div>
                            </div>
                        </div>
                    </div>
					<?php }?>
	    			<?php if($output['order']['order_state']>1){?>
	    				<?php if($output['order']['is_tuihuo']==1){?>
		    				<?php if($output['order']['is_accept']==1){?>
			    				<?php if($output['order']['is_fail']!='1'){?>
			    				<div class="progressItem">
			                        <div class="content">
			                            <div class="title paid">
			                                <div>同意退货</div>
			                            </div>
			                            <div class="detail">
			                                <div class="time">同意时间：<?php echo date("Y年m月d日 H:i",$output['order']['tuihuo_time']);?></div>
			                            </div>
			                        </div>
			                    </div>
		                    	<?php }else{?>
			                    	<?php if($output['order']['state']!=3){?>
				                    <div class="progressItem">
				                        <div class="content">
				                            <div class="title paid">
				                                <div>交易失败</div>
				                            </div>
				                            <div class="detail">
				                            	<div class="time">原因：买家退款</div>
				                                <div class="time">结束时间：<?php echo date("Y年m月d日 H:i",$output['order']['finish_time']);?></div>
				                            </div>
				                        </div>
				                    </div>
				                    <?php }?>
		                    	<?php }?>
		                    <?php }?>	                    
	    				<?php }?>
	    				<?php ?>
	    				<?php if($output['order']['is_fail']==1&&$output['order']['currentexchange']==1){?>
	    				<div class="progressItem">
	                        <div class="content">
	                            <div class="title paid">
	                                <div>交易失败</div>
	                            </div>
	                            <div class="detail">
	                                <div class="time">失败原因：买家未收货</div>
	                            </div>
	                        </div>
	                    </div>
	    				<?php }?>
	    				
	    				<div class="progressItem">
	                        <div class="content">
		                        <a href="http://m.kuaidi100.com/index_all.html?type=<?php echo $output['order']['expresscode']?>&postid=<?php echo $output['order']['express']?>">
		                        <div class="more"><img src="<?php echo TEMPLATE_SITE_URL;?>/images/moreIcon.png" width="19" height="20"></div>
		                        </a>
                            <div class="title delivery">
                            	<?php if($output['order']['order_state']==3){?>                           	
                                <div>已发货</div>
                                <?php }else{?>
	                                <?php if($output['order']['currentexchange']==1){?>
	                                <div>已发货</div>
	                                <?php }else{?>
	                                	<?php if($output['order']['is_fail']!='1'){?>
	                                	<div>已发货,等待确认</div>
	                                	<?php }else{?>
	                                	<div>已发货</div>
	                                	<?php }?>
	                                <?php }?>
                                
                                <?php }?>
                            	</div>
	                            <div class="detail">
	                                <div class="time">发货时间：<?php echo date("Y年m月d日 H:i",$output['order']['fahuo_time']);?></div>
	                            </div>
	                        </div>
	                    </div>
					<?php }?>
    				<?php if($output['order']['order_state']>0){?>
	    				<?php if($output['order']['is_fail']==1&&$output['order']['is_tuihuo']!=1&&$output['order']['currentexchange']!='1'){?>
	    				<div class="progressItem">
	                        <div class="content">
	                            <div class="title paid">
	                                <div>交易失败</div>
	                            </div>
	                            <div class="detail">
	                                <div class="time">失败原因：卖家未发货</div>
	                            </div>
	                        </div>
	                    </div>
	    				<?php }else{?>
	    				<?php if($output['order']['currentexchange']!='1'){?>
	    				<div class="progressItem">
	                        <div class="content">
	                            <div class="title paid">
	                                <div>已付款</div>
	                            </div>
	                            <div class="detail">
	                                <div class="time">付款时间：<?php echo date("Y年m月d日 H:i",$output['order']['payment_time']);?></div>
	                            </div>
	                        </div>
	                    </div>
	                    <?php }?>
	    				<?php }?>

					<?php }?>
					
					<?php if($output['order']['order_state']>0){?>
					<div class="progressItem">
                        <div class="content">
                            <div class="title deal">
                                <div>竞拍成功</div>
                            </div>
                            <div class="detail">
                                <div class="time">成功时间：<?php echo date("Y年m月d日 H:i",$output['auction']['end_time']);?></div>
                            </div>
                        </div>
                    </div>
					<?php }else{?>
						<?php if($output['order']['is_fail']==1){?>
						<div class="progressItem">
	                        <div class="content">
	                            <div class="title deal">
	                                <div>交易失败,买家未付款</div>
	                            </div>
	                            <div class="detail">
	                                <div class="times">截至时间：<?php echo date("Y年m月d日 H:i",($output['auction']['end_time']+3600*48));?></div>
	                            </div>
	                        </div>
	                    </div>							
						<?php }else{?>
						<div class="progressItem">
						<a href="index.php?act=payment&op=orderpayment&order_id=<?php echo $output['order']['id'];?>">
	                        <div class="content">
	                            <div class="title deal">
	                                <div>竞拍成功,立即付款</div>
	                            </div>
	                            <div class="detail">
	                                <div class="time">截至时间：<?php echo date("Y年m月d日 H:i",($output['auction']['end_time']+3600*48));?></div>
	                            </div>
	                        </div>
	                    </a>
	                    </div>					
						<?php }?>
					<?php }?>

                    <div class="progressItem">
                        <div class="content">
                            <div class="title sale">
                                <div>开始竞拍</div>
                            </div>
                            <div class="detail">
                                <div class="time">开始时间：<?php echo date("Y年m月d日 H:i",$output['auction_log']['add_time']);?></div>
                            </div>
                        </div>
                    </div>
    </div>

    <div class="orderMain">
    	<div class="orderItem">
            <div class="title" style="background-image: url(<?php echo $output['user']['avatar'];?>)">
                <div class="nickname">
	        		<a href="<?php echo BASE_SITE_URL;?>/index.php?act=my&op=home&user_id=<?php echo $output['order']['user_id'];?>&uid=<?php echo $output['auction']['seller_id'];?>">               
                    	<?php echo $output['user']['nickname'];?>
                    </a>
                </div>
                <a href="tel:<?php echo $output['user']['mobile'];?>" class="tel"></a>   
                <div class="status">
                        <?php 
                        	if($output['order']['order_state']=='0'){
								if($output['order']['is_fail']==1){
									echo '交易失败';
								}else{
									echo '未付款';
								}
							}elseif($output['order']['order_state']=='1'){
								echo '等待卖家发货';
							}elseif($output['order']['order_state']=='2'){ 
								if($output['order']['is_tuihuo']==1){
									if($output['order']['is_fail']!='1'){
										if($output['order']['is_accept']==1){
											echo '同意退货';
										}else{
											echo '申请退款';
										}	
									}else{
										echo '交易失败';
									}								
								}else{
									if($output['order']['currentexchange']==1&&$output['order']['is_fail']==1){
										echo '交易失败';
									}else{
										echo '未确认收货';
									}
									
								}								
							}else{ 
								echo '交易完成';
							}?>
                </div>
            </div>

            <div class="info">
            	<a href="index.php?act=index&auction_id=<?php echo $output['auction']['id'];?>">
		        <?php if($output['order']['order_state']=='0'){?>
		        <div class="content">
		          <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$output['auction']['auction_add_date'].'/'.$output['auction']['auction_img1'];?>);">
	                <?php if($output['auction']['freeship']==1){?>
	                <div class="post">包邮</div>
	                <?php }?>
		          </div>
		          <div class="desc"><?php echo bearshop_auction_description_substr($output['auction']['auction_description']); ?></div>
		          <?php if($output['order']['is_fail']!='1'){?>  
		          <ul>
		            <li><span>成交金额：</span>￥<?php echo $output['order']['price'];?>元</li> 		                     
		            <li><span>付款截至：</span><span class="process" endtime="<?php if($output['auction']['yikoujia_end']==1){ echo $output['order']['add_time']+2*24*3600; }else{ echo $output['auction']['end_time']+2*24*3600; }?>" con="<?php echo date("Y-m-d H:i:s",($output['auction']['end_time']+2*24*3600));?>" ></span></li>		          	
		          </ul>
		          <?php }else{?>
		          <ul>
		            <li><span>交易失败</li> 		                     
		            <li><span>截至时间：</span><?php echo date("Y-m-d H:i:s",$output['order']['add_time']);?></li>		          	
		          </ul>		          
		          <?php }?>
		        </div> 
		        <div class="pay">
              		应付：<span>￥<?php echo $output['order']['price'];?>元</span>
              	</div>
		        <?php }elseif($output['order']['order_state']=='1'){?>   
		        <div class="content">
		          <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$output['auction']['auction_add_date'].'/'.$output['auction']['auction_img1'];?>);">
		          	<?php if($output['auction']['freeship']==1){?>
	                <div class="post">包邮</div>
	                <?php }?>
		          </div>
		          <div class="desc"><?php echo bearshop_auction_description_substr($output['auction']['auction_description']); ?></div>
		          <ul>
		            <li><span>成交金额：</span>￥<?php echo $output['order']['price'];?>元</li>            
		            <li><span>成交时间：</span><?php echo date("Y-m-d H:i:s",$output['order']['add_time']);?></li>
		          </ul>
		        </div>
		        <?php }elseif($output['order']['order_state']=='2'){?>
		        	<?php if($output['order']['is_fail']!='1'){?>
			        <div class="content">
			          <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$output['auction']['auction_add_date'].'/'.$output['auction']['auction_img1'];?>);">
			          	<?php if($output['auction']['freeship']==1){?>
		                <div class="post">包邮</div>
		                <?php }?>
			          </div>
			          <div class="desc"><?php echo bearshop_auction_description_substr($output['auction']['auction_description']); ?></div>
			          <ul>
			            <li><span>成交金额：</span>￥<?php echo $output['order']['price'];?>元</li>  
			            <?php if($output['order']['is_accept']==1){?>          
			            <li><span>发货截至：</span><?php echo date("Y-m-d H:i:s",($output['order']['tuihuo_time']+7*24*3600));?></li>
			            <?php }elseif($output['order']['is_accept']==2){?>
			            <li><span>确认截至：</span><?php echo date("Y-m-d H:i:s",($output['order']['fahuo_time']+14*24*3600));?></li>			            	
			            <?php }else{?>
			            <li><span>成交时间：</span><?php echo date("Y-m-d H:i:s",$output['order']['add_time']);?></li>
			            <?php }?>
			          </ul>
			        </div>
			        <?php }else{?>
			        <div class="content">
			          <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$output['auction']['auction_add_date'].'/'.$output['auction']['auction_img1'];?>);">
			          	<?php if($output['auction']['freeship']==1){?>
                        <div class="post">包邮</div>
                        <?php }?>
			          </div>
			          <div class="desc"><?php echo bearshop_auction_description_substr($output['auction']['auction_description']); ?></div>
			          <ul>
                        	<li><span>失败原因：</span>买家退货</li>            
            				<li><span>失败时间：</span><?php echo date("Y-m-d H:i:s",$output['order']['finish_time']);?></li>
			          </ul>
			        </div>	        
			        <?php }?>
		        <?php }elseif($output['order']['order_state']=='3'){?>   
		        <div class="content">
		          <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$output['auction']['auction_add_date'].'/'.$output['auction']['auction_img1'];?>);">
		          	<?php if($output['auction']['freeship']==1){?>
	                <div class="post">包邮</div>
	                <?php }?>
		          </div>
		          <div class="desc"><?php echo bearshop_auction_description_substr($output['auction']['auction_description']); ?></div>
		          <ul>
		            <li><span>成交金额：</span>￥<?php echo $output['order']['price'];?>元</li>            
		            <li><span>收货时间：</span><?php echo date("Y-m-d H:i:s",$output['order']['shouhuo_time']);?></li>
		          </ul>
		        </div>
		        <?php }?> 		             
                </a>
              </div>
              
              <div class="tools">
              <?php if($output['order']['order_state']=='0'){?>  
              <?php if($output['order']['is_fail']!='1'){?>
		      		<button order_id="<?php echo $output['order']['id'];?>" class="paymentnow">立即付款</button>
              <?php }?>    	
		      <?php }elseif($output['order']['order_state']=='1'){?>

		      <?php }elseif($output['order']['order_state']=='2'&&$output['order']['is_fail']=='0'){?> 
		      	  <?php if($output['order']['currentexchange']!='1'){?>
			      	  <?php if(($output['order']['is_tuihuo']=='0')&&(($output['order']['fahuo_time']+48*3600)<time())){?>
				      <button class="applytuihuo">申请退款</button>
				      <?php }?>
				      <?php if($output['order']['is_delay']=='1'&& $output['order']['is_fail']=='0'){?>
				      
					      <?php if(($output['order']['is_accept']==1)&&empty($output['order']['tuihuo_express'])){?>
					      <button class="lijituihuo" aid="<?php echo $output['auction']['id'];?>">立即退货</button>
					      <button class="mysendout" aid="<?php echo $output['auction']['id'];?>">确认收货</button>	      
					      <?php }?>
				      <?php }else{?>
				      	  <?php if(($output['order']['is_accept']==1)&&empty($output['order']['tuihuo_express'])){?>
				      	  <button class="lijituihuo" aid="<?php echo $output['auction']['id'];?>">立即退货</button>
				      	  <?php }?>				      	  
				      <?php }?>
			      <?php }else{?>
			      	  <button class="refusecurrentexchange" style="width:100px;">拒绝当面交易</button>	
			      	  <button class="refusesendout">拒绝收货</button>	
			      <?php }?>
			      <?php if(empty($output['order']['is_accept'])||$output['order']['is_accept']==2){?>
			      <button class="mysendout" aid="<?php echo $output['auction']['id'];?>">确认收货</button>
			      <?php }?> 
		      <?php }elseif($output['order']['order_state']=='3'){?>
		      	  <?php if(empty($output['order']['order_comment'])){?>
			      <button order_id="<?php echo $output['order']['id'];?>" class="commentnow">立即评价</button>
			      <?php }?>
		      <?php }?>             
              </div>
           </div>
        </div>

	    <div class="orderInfoMain">
	        <div class="title">订单信息</div>
	        <div class="saleUri">
	        	<span class="label">卖家电话：</span>
	        	<span class="value"><a class="buynumber" href="tel:<?php echo $output['user']['mobile'];?>"></a><?php echo $output['user']['mobile'];?></span>
	        </div>   
	        <div class="saleUri">
	        	<span class="label">拍品编号：</span>
	        	<span class="value"><?php echo $output['auction']['auction_sn']?></span>
	        </div>
	        <div class="saleUri">
	        	<span class="label">货款交易单号：</span>
	        	<span class="value"><?php echo $output['order']['order_sn']?></span>
	        </div>
	        <?php if(($output['order']['is_accept']==2)&&($output['order']['is_fail']!=1)&&empty($output['platform'])){?>
	        <div class="customer">
               <a class="cusBn" href="index.php?act=order&op=platdeal&order_id=<?php echo $output['order']['id'];?>">小二介入</a>
            </div>
            <?php }?>
	    </div>
	    
	    <?php if($output['order']['order_state']>1){?>
	    	<?php if($output['order']['currentexchange']!='1'){?>
		    <div class="orderInfoMain">
		        <div class="title">收发货信息</div>
		        <div class="saleUri">
		        	<span class="label">收货人：</span>
		        	<span class="value"><?php echo $output['address']['name'];?></span>
		        	<span class="valueleft"><?php echo $output['address']['tele'];?></span>
		        </div>
		        <div class="saleUri">
		        	<span class="value">
		        		<?php echo $output['address']['prov_name'];?>
            			<?php echo $output['address']['city_name'];?>
           				<?php echo $output['address']['dis_name'];?>
		        		<?php echo $output['address']['address'];?>
		        	</span>	
		        </div>
		        <?php if($output['order']['is_express']==1){?>
		        <div class="saleUri">	        	        	
		        	<span class="label">发货方式</span>
	            	<span class="valueleft"><?php echo $output['order']['expresscode'];?>(单号：<?php echo $output['order']['express'];?>)</span>            	
		        </div>
		        <?php }?>
		    </div>
		    <?php }else{?>
		    <div class="orderInfoMain">
		        <div class="saleUri">	        	        	
		        	<span class="label">发货方式：</span>
	            	<span class="value">当面交易</span>            	
		        </div>
		    </div>	
		    <?php }?>
	    <?php }?>
	    
	    <?php if($output['order']['is_tuihuo']==1){?>
	    <div class="orderInfoMain">
	        <div class="title">争议信息</div>
	        <?php if(!empty($output['refund'])){?>
	        <?php foreach($output['refund'] as $val){?>
	        <div class="saleUri">
	        	<span class="label"><?php if($val['type']==1){ echo '卖家';}else{ echo '买家';}?>：</span>
	        	<span class="value"><?php echo $val['refund_reason'];?></span>
	        	<span class="valueleft"><?php echo date("Y-m-d",$val['refund_add_time']);?></span>
	        </div>
	        <?php }?>
	        <?php }?>
	    </div>
	    <?php }?>
	    
		<?php if(!empty($output['order']['tuihuo_address'])){?>
	    <div class="orderInfoMain">
        	<div class="title">退货信息</div>
        	<div class="saleUri">
	        	<span class="label">收货人：</span>
	        	<span class="value"><?php echo $output['tuihuo_address']['name'];?></span>
	        	<span class="valueleft"><?php echo $output['tuihuo_address']['tele'];?></span>
	        </div>
	        <div class="saleUri">
	        	<span class="value">
	        		<?php echo $output['tuihuo_address']['prov_name'];?>
            		<?php echo $output['tuihuo_address']['city_name'];?>
           			<?php echo $output['tuihuo_address']['dis_name'];?>
	        		<?php echo $output['tuihuo_address']['address'];?>
	        	</span>	
	        </div>
	        <?php if(!empty($output['order']['tuihuo_expresscode'])){?>
        	<div class="saleUri">	        	        	
	        	<span class="label">发货方式</span>
            	<span class="value"><?php echo $output['order']['tuihuo_expresscode'];?></span>
            	<span class="valueleft">(单号：<?php echo $output['order']['tuihuo_express'];?>)</span>            	
	        </div>
	        <?php }?>
	    </div>    
	    <?php }?>    
	    
    </div>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/layer.m.js" charset="utf-8"></script>
<script type="text/javascript">
$(function(){
	$('.paymentnow').click(function(){
		var order_id = $(this).attr('order_id');
		location.href = 'index.php?act=payment&op=orderpayment&order_id='+order_id;
	});

	$('.delayshouhuo').click(function(){
		var order_id = '<?php echo $_GET['order_id']?>';
		$.ajax({
			type:'get',
			url:'index.php?act=order&op=delay',
			data:{order_id:order_id},
			dataType:'json',
			success:function(data){
				if(data.state){
					location.reload();
				}
			}
		});
	});

	$('.applytuihuo').click(function(){
		var order_id = '<?php echo $_GET['order_id']?>';
		location.href = "index.php?act=payment&op=tuihuo&order_id="+order_id;
	});
	
	$('.commentnow').click(function(){
		var order_id = $(this).attr('order_id');
		location.href = 'index.php?act=payment&op=comment&order_id='+order_id;
	});	

	$('.lijituihuo').click(function(){
		location.href = 'index.php?act=order&op=lijituihuo&order_id='+<?php echo $_GET['order_id']?>;
	});

	$('.confirmshouhuo').click(function(){
		var auction_id = '<?php echo $output['auction']['id']?>';
	    $.ajax({
			type:'get',
			url:'index.php?act=my&op=mysendout',
			data:{auction_id:auction_id},
			dataType:'json',
			success:function(res){
				if(res.state){
					location.href='index.php?act=order&op=orderuserdetail&order_id=<?php echo $output['order']['id']?>';
				}
				return false;
			}
		});
	});
	
	$(".mysendout").click(function(){
		$('#pop').show();
	});


	$('.cancel').click(function(){
		$('#pop').hide();
	});
	
	$('.refusecurrentexchange').click(function(){
		var order_id = '<?php echo intval($_GET['order_id']);?>';
		location.href = 'index.php?act=payment&op=orderpayment&order_id='+order_id;
	});
	
	$('.refusesendout').click(function(){
		var order_id = '<?php echo intval($_GET['order_id']);?>';
		if(confirm('确认拒绝收货？')){
		    $.ajax({
				type:'get',
				url:'index.php?act=order&op=refusesendout',
				data:{order_id:order_id},
				dataType:'json',
				success:function(res){
					if(res.state=='1'){
						location.reload();
					}
					return false;
				}
			});
		}
	});
});

</script>
<script type='text/javascript'>
	$(function(){
		var time = parseInt("<?php echo TIMESTAMP;?>");
		$('.process').each(function(){
			var lag = parseInt($(this).attr('endtime')) - time;
			if(lag>0){
			   var second = Math.floor(lag % 60);    
			   var minite = Math.floor((lag / 60) % 60);
			   var hour = Math.floor((lag / 3600) % 24);
			   var day = Math.floor((lag / 3600) / 24);
			   $(this).html('<span style="color:#910012;font-size:16px;">&nbsp;'+day+'&nbsp;</span>'+'<?php echo $lang['bearshop_day'];?>'+'<span style="color:#910012;font-size:16px;">&nbsp;'+hour+'&nbsp;</span>'+'<?php echo $lang['bearshop_hour'];?>'+'<span style="color:#910012;font-size:16px;">&nbsp;'+minite+"&nbsp;</span>"+'<?php echo $lang['bearshop_minute'];?>'+'<span style="color:#910012;font-size:16px;">&nbsp;'+second+'&nbsp;</span>');

			}
		});
		function updateEndTime(){
			time++;		
			$(".process").each(function(){
				var lag = parseInt($(this).attr('endTime')) - time;
				if(lag>0){
				    var second = Math.floor(lag % 60);    
				    var minite = Math.floor((lag / 60) % 60);
				    var hour = Math.floor((lag / 3600) % 24);
				    var day = Math.floor((lag / 3600) / 24);
					$(this).html('<span style="color:#910012;font-size:16px;">&nbsp;'+day+'&nbsp;</span>'+'<?php echo $lang['bearshop_day'];?>'+'<span style="color:#910012;font-size:16px;">&nbsp;'+hour+'&nbsp;</span>'+'<?php echo $lang['bearshop_hour'];?>'+'<span style="color:#910012;font-size:16px;">&nbsp;'+minite+"&nbsp;</span>"+'<?php echo $lang['bearshop_minute'];?>'+'<span style="color:#910012;font-size:16px;">&nbsp;'+second+'&nbsp;</span>');
				    
				}else{
					location.reload();
				}
			});
			setTimeout(updateEndTime,1000);
		}
		setTimeout(updateEndTime,1000);
	});
</script>
<?php include template('home/nav');?>
</body>
</html>